//test for gainCard()

#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "rngs.h"

#define DEBUG 0
#define NOISY_TEST 1

int main () {

  int r;
  int k[10] = {adventurer, council_room, feast, gardens, mine,
	       remodel, smithy, village, baron, great_hall};

  struct gameState G;
  
  r = initializeGame(2, k, 1, &G);

  puts("\n\n********* UNIT TEST 4 -GAINCARD ************\n");
  printf ("initializeGame(2, k, 1, &G) = %d\n", r);
  assert(r == 0);

  printf("initial hand count:%d\n", numHandCards(&G) );
  int supPos = 1;
  int toFlag = 2; //gain card to hand
  int initSup = G.supplyCount[supPos];

  gainCard( supPos, &G, toFlag, 0 );

  printf("after gainCard(), hand count:%d\n", numHandCards(&G) );

  assert( numHandCards(&G) == 6);
  assert(G.supplyCount[supPos] == initSup - 1);

 

  

  printf("testGainCard: PASS\n" );







  
  return 0;
}
